package com.zoffy.ybuhelper.fragment;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.zoffy.ybuhelper.*;
import org.jetbrains.annotations.NotNull;

public class ToolFragment extends Fragment {
    @SuppressLint("InflateParams")
    @Nullable
    @org.jetbrains.annotations.Nullable
    @Override
    public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
        View view= inflater.inflate(R.layout.fragment_tools,null,false);
        buttonInit(view);
        return view;
    }


    protected void buttonInit(View view){
        Button whatEatButton=view.findViewById(R.id.whateat);
        whatEatButton.setOnClickListener(v -> {
            Intent intent=new Intent();
            intent.setClass(getActivity(), WhatEatActivity.class);
            startActivity(intent);
        });


        Button webButton=view.findViewById(R.id.stdu_system);
        webButton.setOnClickListener(v -> {
            Intent intent=new Intent();
            intent.setClass(getActivity(), StudyWebActivity.class);
            startActivity(intent);
        });
        view.findViewById(R.id.fire_gpt).setOnClickListener(v->{
            Intent intent=new Intent();
            intent.setClass(getActivity(), FireGPTActivity.class);
            startActivity(intent);
        });
        view.findViewById(R.id.bi).setOnClickListener(v->{
            Intent intent=new Intent();
            intent.setClass(getActivity(), BiWebActivity.class);
            startActivity(intent);
        });
    }
}
